<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python documentation Index' />
<link rel="first" href="lib.html" title='Python library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="module-gl.html" />
<link rel="prev" href="module-flp.html" />
<link rel="parent" href="sgi.html" />
<link rel="next" href="module-gl.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>34.7 fm -- Font Manager interface</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="34.6 flp  "
  href="module-flp.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="34. sgi IRIX Specific"
  href="sgi.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="34.8 gl  "
  href="module-gl.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-flp.html">34.6 flp  </a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="sgi.html">34. SGI IRIX Specific</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-gl.html">34.8 gl  </a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->

<h1><a name="SECTION0036700000000000000000">
34.7 <tt class="module">fm</tt> --
         <em>Font Manager</em> interface</a>
</h1>

<p>
<a name="module-fm"></a>  
<p class="availability">Availability: <span
 class="platform">IRIX</span>.</p>

<p>
This module provides access to the IRIS <em>Font Manager</em> library.
<a id='l2h-5701' xml:id='l2h-5701'></a>
It is available only on Silicon Graphics machines.
See also: <em>4Sight User's Guide</em>, section 1, chapter 5: ``Using
the IRIS Font Manager.''

<p>
This is not yet a full interface to the IRIS Font Manager.
Among the unsupported features are: matrix operations; cache
operations; character operations (use string operations instead); some
details of font info; individual glyph metrics; and printer matching.

<p>
It supports the following operations:

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5689' xml:id='l2h-5689' class="function">init</tt></b>(</nobr></td>
  <td><var></var>)</td></tr></table></dt>
<dd>
Initialization function.
Calls <tt class="cfunction">fminit()</tt>.
It is normally not necessary to call this function, since it is called
automatically the first time the <tt class="module">fm</tt> module is imported.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5690' xml:id='l2h-5690' class="function">findfont</tt></b>(</nobr></td>
  <td><var>fontname</var>)</td></tr></table></dt>
<dd>
Return a font handle object.
Calls <code>fmfindfont(<var>fontname</var>)</code>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5691' xml:id='l2h-5691' class="function">enumerate</tt></b>(</nobr></td>
  <td><var></var>)</td></tr></table></dt>
<dd>
Returns a list of available font names.
This is an interface to <tt class="cfunction">fmenumerate()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5692' xml:id='l2h-5692' class="function">prstr</tt></b>(</nobr></td>
  <td><var>string</var>)</td></tr></table></dt>
<dd>
Render a string using the current font (see the <tt class="function">setfont()</tt> font
handle method below).
Calls <code>fmprstr(<var>string</var>)</code>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5693' xml:id='l2h-5693' class="function">setpath</tt></b>(</nobr></td>
  <td><var>string</var>)</td></tr></table></dt>
<dd>
Sets the font search path.
Calls <code>fmsetpath(<var>string</var>)</code>.
(XXX Does not work!?!)
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5694' xml:id='l2h-5694' class="function">fontpath</tt></b>(</nobr></td>
  <td><var></var>)</td></tr></table></dt>
<dd>
Returns the current font search path.
</dl>

<p>
Font handle objects support the following operations:

<p>

<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5695' xml:id='l2h-5695' class="function">scalefont</tt></b>(</nobr></td>
  <td><var>factor</var>)</td></tr></table></dt>
<dd>
Returns a handle for a scaled version of this font.
Calls <code>fmscalefont(<var>fh</var>, <var>factor</var>)</code>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5696' xml:id='l2h-5696' class="function">setfont</tt></b>(</nobr></td>
  <td><var></var>)</td></tr></table></dt>
<dd>
Makes this font the current font.
Note: the effect is undone silently when the font handle object is
deleted.
Calls <code>fmsetfont(<var>fh</var>)</code>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5697' xml:id='l2h-5697' class="function">getfontname</tt></b>(</nobr></td>
  <td><var></var>)</td></tr></table></dt>
<dd>
Returns this font's name.
Calls <code>fmgetfontname(<var>fh</var>)</code>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5698' xml:id='l2h-5698' class="function">getcomment</tt></b>(</nobr></td>
  <td><var></var>)</td></tr></table></dt>
<dd>
Returns the comment string associated with this font.
Raises an exception if there is none.
Calls <code>fmgetcomment(<var>fh</var>)</code>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5699' xml:id='l2h-5699' class="function">getfontinfo</tt></b>(</nobr></td>
  <td><var></var>)</td></tr></table></dt>
<dd>
Returns a tuple giving some pertinent data about this font.
This is an interface to <code>fmgetfontinfo()</code>.
The returned tuple contains the following numbers:
<code>(</code><var>printermatched</var>, <var>fixed_width</var>, <var>xorig</var>,
<var>yorig</var>, <var>xsize</var>, <var>ysize</var>, <var>height</var>,
<var>nglyphs</var><code>)</code>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-5700' xml:id='l2h-5700' class="function">getstrwidth</tt></b>(</nobr></td>
  <td><var>string</var>)</td></tr></table></dt>
<dd>
Returns the width, in pixels, of <var>string</var> when drawn in this font.
Calls <code>fmgetstrwidth(<var>fh</var>, <var>string</var>)</code>.
</dl>

<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="34.6 flp  "
  href="module-flp.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="34. sgi IRIX Specific"
  href="sgi.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="34.8 gl  "
  href="module-gl.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-flp.html">34.6 flp  </a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="sgi.html">34. SGI IRIX Specific</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-gl.html">34.8 gl  </a>
</div>
</div>
<hr />
<span class="release-info">Release 2.5.1, documentation updated on 18th April, 2007.</span>
</div>
<!--End of Navigation Panel-->
<address>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</address>
</body>
</html>
